<template>
  <div 
    class="deep-thinking-toggle flex items-center gap-4px p-10px rounded-10px cursor-pointer font-size-12px" 
    :class="{ active: appStore.isDeepThinking }" 
    @click="toggleDeepThinking"
  >
    <img 
      v-if="appStore.isDeepThinking" 
      src="@/assets/images/ai/deepThinkingActived.png" 
      alt="深度思考已激活" 
      class="toggle-icon"
    />
    <img 
      v-else 
      src="@/assets/images/ai/deepThinking.png" 
      alt="深度思考" 
      class="toggle-icon"
    />
    <span class="toggle-text">深度思考</span>
  </div>
</template>

<script setup lang="ts">
import { useAppStore } from '@/stores/modules/app';

const appStore = useAppStore();

const toggleDeepThinking = () => {
  appStore.setDeepThinking(!appStore.isDeepThinking);
};
</script>

<style scoped lang="scss">
.deep-thinking-toggle {
  white-space: nowrap;
  user-select: none;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
  border: 1px solid #e8e8e8;
  background-color: var(--el-fill-color-lighter, #f5f7fa);
  color: var(--el-text-color-regular, #606266);
  transition: all 0.3s;
  &:hover {
    background-color: var(--el-fill-color, #f0f2f5);
    border-color: var(--el-border-color, #dcdfe6);
  }

  &:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  &.active {
    background-color: var(--el-color-primary-light-9, #ecf5ff);
    border-color: var(--el-color-primary-light-5, #a0cfff);
    color: var(--el-color-primary, #409eff);
  }

  .toggle-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
  }

  .toggle-text {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
  }
}
</style>